package com.vimeworks.vimemannager.modelo.parametros;

// Generated Jul 17, 2012 4:05:51 PM by Hibernate Tools 3.4.0.CR1

import com.vimeworks.vimemannager.modelo.aplicacion.Tarea;
import java.util.HashSet;
import java.util.Set;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.Id;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.persistence.UniqueConstraint;

/**
 * TipoTarea generated by hbm2java
 */
@Entity
@Table(name = "vm_tipo_tarea", schema = "public", uniqueConstraints = @UniqueConstraint(columnNames = "nombre"))
public class TipoTarea implements java.io.Serializable {

	private String codigo;
	private String nombre;
	private Set<Tarea> tareas = new HashSet<Tarea>(0);

	public TipoTarea() {
	}

	public TipoTarea(String codigo, String nombre) {
		this.codigo = codigo;
		this.nombre = nombre;
	}

	public TipoTarea(String codigo, String nombre, Set<Tarea> tareas) {
		this.codigo = codigo;
		this.nombre = nombre;
		this.tareas = tareas;
	}

	@Id
	@Column(name = "codigo", unique = true, nullable = false, length = 3)
	public String getCodigo() {
		return this.codigo;
	}

	public void setCodigo(String codigo) {
		this.codigo = codigo;
	}

	@Column(name = "nombre", unique = true, nullable = false, length = 20)
	public String getNombre() {
		return this.nombre;
	}

	public void setNombre(String nombre) {
		this.nombre = nombre;
	}

	@OneToMany(fetch = FetchType.LAZY, mappedBy = "tipoTarea")
	public Set<Tarea> getTareas() {
		return this.tareas;
	}

	public void setTareas(Set<Tarea> tareas) {
		this.tareas = tareas;
	}

}
